跳到主要内容

11.旅鼠2

参见:Lemmings1。

除了向左走和向右走之外,如果Lemmings脚下的地面消失,它们还会坠落(并可能会发出“啊!”的声音)。

除了向左走和向右走以及在碰撞时改变方向外,当ground=0时,Lemming会坠落并发出“啊!”的声音。当地面重新出现(ground=1)时,Lemming会继续以坠落前相同的方向行走。在坠落期间被碰撞不会影响行走方向,并且在地面消失的同一周期内(但尚未开始坠落)或地面重新出现而仍在坠落的过程中被碰撞,也不会影响行走方向。 构建一个有限状态机来模拟这种行为。

alt text

参见:Lemmings3和Lemmings4。

模块声明

module top_module(
input clk,
input areset, // Freshly brainwashed Lemmings walk left.
input bump_left,
input bump_right,
input ground,
output walk_left,
output walk_right,
output aaah );

做题区